package com.yflutter.yfree_app.activity

import android.webkit.JavascriptInterface
import com.yflutter.yfree_app.R
import com.yfree.activities.YActivity
import com.yfree.activities.YWebActivity
import com.yfree.utils.YJSDelegate
import com.yfree.views.YWebView

class H5Activity : YWebActivity() {
    override fun getWebName() = "h5/app/html/index.html"
    override fun getLayout() = R.layout.activity_h5
    override fun getJSDelegate() = H5JSDelegate::class.java
}

class H5JSDelegate(yActivity: YActivity, webView: YWebView) : YJSDelegate(yActivity, webView) {
    @JavascriptInterface
    fun runNative(param: Any) {
        yActivity.yToast("YFree_H5调用原生代码")
    }
}